import 'package:flutter/material.dart';

appBar(VoidCallback rigthButtonClick,String title, String rightTitle,{bool centertitle=false}) {
  return AppBar(
    centerTitle: centertitle,
    titleSpacing: 0,
    leading: const BackButton(),
    title: Text(
      title,
      style: const TextStyle(fontSize: 18),
    ),
    actions: [
      InkWell(
        onTap: rigthButtonClick,
        child: Container(
          padding: const EdgeInsets.symmetric(horizontal: 15),
          alignment: Alignment.center,
          child: Text(
            rightTitle,
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 18, color: Colors.grey[500]),
          ),
        ),
      )
    ],
  );
}
